package com.lazybones.base.engineer.common.exception;

import com.lazybones.base.engineer.common.enums.StatusEnum;

public class LazyBonesException extends RuntimeException{
    private  Integer code;

    public LazyBonesException(Integer code) {
        this.code = code;
    }

    public LazyBonesException() {
    }

    public LazyBonesException(Integer code, String message) {
        super(message);
        this.code = code;
    }
    public LazyBonesException(StatusEnum statusEnum){
        super(statusEnum.getMessage());
        this.code=statusEnum.getCode();
    }
    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
    @Override
    public String toString(){
        return  "CreditException {" +"code =" +code+"message="+this.getMessage()+"}";
    }

}
